<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
var arr = [10, 200, 300, 500]
console.log(arr[0]);
arr[0] = 100;
console.log(arr)

//直接更改 length 属性
/*arr.length = 10
console.log(arr);*/
arr[arr.length] = 1000
console.log(arr)
arr[100] = 200;
console.log(arr.length);
</script>
</body>
</html>